package org.example;

import org.example.controller.UController;
import org.example.controller.UserController;
import org.example.model.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.Scanner;

@Configuration
public class Application {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//        UserController userController =
//                context.getBean("userController", UserController.class);
//        userController.doController();
//
//        UController uController =
//                context.getBean("UController", UController.class);
//        uController.doController();

        User user1 = context.getBean("user_default", User.class);
        System.out.println(user1);

        User user2 = context.getBean("user_cp", User.class);
        System.out.println(user2);

    }
}
